home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / E32.ZIP / CASE.ASM < prev    next >
Assembly Source File  |  1994-04-29  |  1KB  |  62 lines

  1. ; CASE.ASM for E32 - Copyright (C) 1994 Douglas Herr
  2. ;  all rights reserved
  3.  
  4. include    model.inc
  5.  
  6. public    locase, upcase
  7. extrn    advance:near, mark:near
  8. extrn    working:near
  9.  
  10. extrn    strnlwr:near
  11. extrn    strnupr:near
  12. extrn    clearkey:near
  13.  
  14. include    dataseg.inc
  15. extrn    cursor:dword
  16. extrn    mark_mode:byte, mark_start:dword, mark_end:dword
  17. extrn    dirty_bits:byte
  18. @curseg    ends
  19.  
  20. include    codeseg.inc
  21. ;
  22. ;  locase converts the character at
  23. ;  the current position to lower case
  24. ;
  25. locase    proc    near
  26.     lea    eax,strnlwr
  27.     jmp    short ul
  28. ;
  29. ;  UPCASE converts the character at
  30. ;  the current position to upper case
  31. ;
  32. upcase    label    near
  33.     lea    eax,strnupr
  34. ul:    mov    ecx,1        ; default: one character
  35.     mov    ebx,cursor
  36.     cmp    mark_mode,0    ; mark mode OFF?
  37.     je    short l0    ;  yup, do one character
  38.  
  39.     mov    ecx,mark_end    ; get end of mark region
  40.     mov    ebx,mark_start    ; get start of mark region
  41.     sub    ecx,ebx        ; number of bytes selected
  42.     call    working
  43.  
  44. l0:    push    ds
  45.     push    fs
  46.     pop    ds
  47.     call    eax
  48.     pop    ds
  49.     cmp    mark_mode,0    ; is mark_mode on?
  50.     jz    short exit    ; nope - redraw line & advance cursor
  51.     call    mark
  52.     or    dirty_bits,11000000b
  53.     ret
  54. exit:    or    dirty_bits,4    ; redraw line
  55.     call    advance
  56.     ret
  57.  
  58. locase    endp
  59.  
  60. @curseg    ends
  61.     end
  62.